package vn.demand.dragon.model.business
{
	import mx.controls.Alert;
	import mx.rpc.AsyncToken;
	import mx.rpc.IResponder;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;

	public class LoadReferencesDelegate 
	{
		private var responder : IResponder;
		private var service : HTTPService;

		public function LoadReferencesDelegate(result:Function, fault:Function) 
		{
			// constructor will store a reference to the service we're going to call
			this.service = new HTTPService();
			this.service.url = "http://dev.dragon.com/index.php?m=projects&a=references_xml&suppressHeaders=1";
			this.service.method = 'POST';
			this.service.resultFormat = 'e4x';
			this.service.addEventListener(ResultEvent.RESULT, result);
			this.service.addEventListener(FaultEvent.FAULT, fault);
			// and store a reference to the proxy that created this delegate
		}

		public function loadReferences(params:Object = null) : void 
		{
			if (params == null) {
				params = new Object();
			}
//			params.m = 'quotations';
//			params.a = 'quote_search';
//			params.suppressHeaders = '1';
			// call the service
			var token:AsyncToken = service.send(params);
		}
	}
}